﻿#if NETFX_CORE || WINDOWS_PHONE

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Windows.Storage;

namespace WindowsCommonStorage
{
    internal class NetFxCoreApplicationData:CommonAppllicationData
    {
        private ApplicationData _appdata;

        internal static readonly NetFxCoreApplicationData _current = new NetFxCoreApplicationData ( ApplicationData.Current );

        internal NetFxCoreApplicationData(ApplicationData appData)
        {
            _appdata = appData;
            _localFolder = new NetFxCoreStorageFolder { _folder = this._appdata.LocalFolder };
            _romingFolder = new NetFxCoreStorageFolder { _folder = this._appdata.RoamingFolder };
            _temporaryFolder = new NetFxCoreStorageFolder { _folder = this._appdata.TemporaryFolder };
            

        }

        protected internal override async Task ProtectedClearAsync()
        {
            await this._appdata.ClearAsync();
        }

        protected internal override CommonStorageFolder ProtectedLocalFolder
        {
            get { return _localFolder; }
        }
        private CommonStorageFolder _localFolder;

        protected internal override CommonStorageFolder ProtectedRomingFolder
        {
            get { return _romingFolder; }
        }
        private CommonStorageFolder _romingFolder;

        protected internal override CommonStorageFolder ProtectedTemporaryFolder
        {
            get { return _temporaryFolder; }
        }
        private CommonStorageFolder _temporaryFolder;
    }
}
#endif